{% extends "ioffice/admin/main.html" %}
{% block title %}
    <title>自动化办公 - 用户编辑</title>
{% endblock %}
{% block extra %}
    <link href="{{static ('css/libs/iCheck/custom.css')}}" rel="stylesheet">
    <link href="{{static ('css/libs/layer/skin/layer.css')}}" rel="stylesheet">
{% endblock %}
{% block main %}
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">基本资料</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="panel-body">
				                <form id="updateForm" class="form-horizontal">
				                    <input type="hidden" name="user_id" value="{{data.user.id}}">
				                    <div class="form-group"> 
				                        <label  class="col-sm-5 control-label">用户名：</label> 
				                        <div class="col-md-3"> 
				                            <p class="form-control-static">{{data.user.username}}</p>
			                            </div> 
				                    </div>
				                    <div class="form-group"> 
				                        <label class="col-sm-5 control-label">昵称：</label> 
				                        <div class="col-md-3"> 
				                            <input class="form-control" name="first_name" type="text" placeholder="请输入昵称" value="{{data.user.first_name}}"/>
			                            </div> 
				                    </div>
				                    <div class="form-group"> 
				                        <label class="col-sm-5 control-label">邮箱：</label> 
				                        <div class="col-md-3"> 
				                            <input class="form-control" name="email" type="text" placeholder="邮箱" value="{{data.user.email}}",/>
			                            </div> 
				                    </div>
				                    <div class="form-group"> 
				                        <label class="col-sm-5 control-label">手机：</label> 
				                        <div class="col-md-3"> 
				                            <input class="form-control" name="mobile" type="text" placeholder="请输入手机号码" value="{{data.user.mobile}}",/>
			                            </div> 
				                    </div>
				                    <div class="form-group"> 
			                            <label  class="col-sm-5 control-label">类型：</label> 
				                        <div class="col-md-3"> 
				                            <select class="form-control" name="user_type">
				                                {% for utype in data.user_types%}
		                                            <option value="{{utype.id}}" {% if utype.id == data.user.user_type %} selected="selected" {% endif %}>{{utype.name}}</option>
		                                        {% endfor %}
		                                    </select>
				                        </div>
				                    </div> 
				                    <div class="form-group"> 
			                            <label  class="col-sm-5 control-label">状态：</label> 
				                        <div class="col-md-3"> 
				                            <select class="form-control" name="is_active">
		                                        <option value="0" {% if data.user.is_active == 0 %}selected="selected"{% endif %}>停用</option>
		                                        <option value="1" {% if data.user.is_active == 1 %}selected="selected"{% endif %}>正常</option>
		                                    </select>
				                        </div>
				                    </div> 
				                    {% if data.user.avatar_url %}
				                    <div class="form-group"> 
				                        <label class="col-sm-5 control-label">头像：</label> 
				                        <div class="col-md-3 text-center"> 
				                            <img width="100px" height="100px" src="{{data.user.avatar_url}}"/>
			                            </div> 
				                    </div>
				                    {% endif %}
				                    <div class="form-group"> 
				                        <label class="col-sm-5 control-label">性别：</label> 
		                                <div class="col-sm-3">
			                                {% for sex in data.sexs %}
			                                    <div class="radio i-checks pull-left">
			                                        <label>
			                                            <input type="radio" {% if data.user.sex == sex.id %}checked="checked" {% elif data.user.sex == "" and sex.id == 'N' %}checked="checked"{% endif %} value="{{sex.id}}" name="sex"> 
			                                            <i></i> {{sex.name}}
			                                        </label>
			                                    </div>
		                                    {% endfor %}
		                                </div>
				                    </div>
				                    <div class="conform-cencel input-lg">
				                        <label  class="col-sm-4 control-label"></label>
				                        <div class="col-md-4 text-center"> 
									        <span class="btn btn-primary save">确认</span>
					                    </div> 
								    </div>
				                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
{% endblock %}
{% block entry_js %}
    <script data-main="{{ static('js/auoffice/account/admin/user/edituser.js') }}"
            src="{{ static('js/libs/require.js') }}"></script>
{% endblock %}
